<script>
  export default {
    onLaunch: function(params) {
		const token = params.query.token || uni.getStorageSync('larsonToken') || '';
		uni.setStorageSync('larsonToken', token);
		uni.removeStorageSync('userInfo');
		if (!token) {
			uni.showToast({ title: 'token为空', icon: 'none' });
			return;
		}
		uni.showLoading({
			title: '加载中',
			mask: true,
		});
		uni.$request({
			method: 'GET',
			url: 'https://api.jxdev.mirrorego.com/user/api/user/userInfo',
		 }).then((res) => {
			// uni.setStorageSync('userInfo', JSON.stringify(res.data));
			uni.setStorage({
				key: 'userInfo',
				data: JSON.stringify(res.data),
				success: function () {
					uni.$emit('user-info-update');
				},
			});
		}).finally(uni.hideLoading);
    },
  }
</script>

<style>
.container {
	padding: 15px;
	overflow: hidden;
}

.cut_font, .cut_font_1 {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cut_font_2 {
    overflow: hidden;
    text-overflow:ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.1;
}

.cut_font_3 {
    overflow: hidden;
    text-overflow:ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.1;
}
</style>
